// -----------------------------------------------------------------------------
// DM 是 .NET 5 平台下开发管理的系统。
// Copyright © 2021 DM,  Co.,Ltd.
//
// 框架名称：Furion
// 后台框架：ABC.Admin
// -----------------------------------------------------------------------------

using Furion.TaskScheduler;

namespace Abc.Application.Scheduler
{
    /// <summary>
    /// Web 初始化延迟执行
    /// </summary>
    public class WebInitDelayJob : ISpareTimeWorker
    {
        /// <summary>
        /// 3s 后执行
        /// </summary>
        /// <param name="timer"></param>
        /// <param name="count"></param>
        [SpareTime(3000, "WebInitDelayJob", DoOnce = true, StartNow = true)]
        public void DoSomething(SpareTimer timer, long count)
        {
            //var scopeFactory = App.GetService<IServiceScopeFactory>();
            //using (var scope = scopeFactory.CreateScope())
            //{
            //    var services = scope.ServiceProvider;

            //    //// 获取数据库上下文
            //    //var dbContext = Db.GetDbContext(services);
            //    // 获取仓储
            //   // var respository = Db.GetRepository<User>(services);

            //}
        }
    }
}